package com.dkd.handler;

import cn.elegent.ac.ACHandler;
import cn.elegent.ac.annotation.Topic;
import com.dkd.config.TopicConfig;
import com.dkd.contract.VendoutResultContract;
import com.dkd.service.VendoutRunningService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author DiXiaoNie
 * @since 2023/2/5 12:25
 */
@Topic(TopicConfig.VMS_RESULT_TOPIC)
@Slf4j
public class VMVendOutResultHandler implements ACHandler<VendoutResultContract> {
    @Autowired
    private VendoutRunningService vendoutRunningService;

    @Override

    public void process(String topic, VendoutResultContract vendoutResultContract) throws Exception {
        log.info("执行出货结构回调：{}", vendoutResultContract);
        //更新售货机库存
        this.vendoutRunningService.vendOutResult(vendoutResultContract);

    }
}
